﻿/*       _\|/_
         (o o)
+-----oOO-{_}-OOo---------------------+
| Copyright (c) 2005 - 2006           |
| Toenda Software Development         |
+-------------------------------------+
| 
| Language: JavaScript
| File: Counter.cs
|
+
*/

var sec = 60;
var min = 0;
var hour = 0;

function TimeCount(init_hour, init_min, init_sec, item_hour, item_min, item_sec) {
	hour = this.hour;
	min = this.min;
	sec = this.sec;
	setTimeout("_CountDown('" + item_hour + "','" + item_min + "','" + item_sec + "')",1000);
}

function _CountDown(item_hour, item_min, item_sec){
	sec -= 1;
	
	if(sec < 0 ) {
		sec = 59;
		min -= 1;
		if(min < 0 ) {
			min = 59;
			hour -= 1;
			if(hour < 0 )
					DoPostBack();
		}
	}
	
	if(sec < 10)
		document.getElementById(item'_sec').innerText = '0' + sec;
	else
		document.getElementById('txt_sec').innerText = '' + sec;
	
	if(min < 10)
		document.getElementById(item_min).innerText = '0' + min;
	else
		document.getElementById(item_min).innerText = '' + min;
	
	document.getElementById(item_hour).innerText = '' + hour;
	document.getElementById('txt_day').innerText = '' + day;
	
	setTimeout("_CountDown('" + item_hour + "','" + item_min + "','" + item_sec + "')",1000);
}
